package cn.zh.blog.controller;

import cn.zh.blog.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author 郑豪
 * @Date 2020/4/8 22:37
 **/

@Controller
public class ArchiveShowController {
    @Autowired
    private BlogService blogService;


    @GetMapping("/archives")
    public String archives(Model model) {
        model.addAttribute("archiveMap",blogService.archiveBlog());
        model.addAttribute("blogCount",blogService.countBlog());
        return "archives";
    }
}
